<div class="page">
	<div class="page-header">
		<h2><?php echo __('Relatório Analítico de Depreciação de Bens');?>
		</h2>
		<div class="page-header-fields">
			<?php echo $this->Html->link('<i class="icon-plus icon-white"></i>'.__('Add Conta Contabils'), array('action' => 'add'), array('escape' => false, 'class' => 'btn btn-primary')); ?>
		</div>
	</div>
	<div class="page-content">	
	
			<?php echo $this->Form->create('Relatorio', array('class' => 'well', 'action' => 'analitico_depreciacao_pdf')); ?>
				<div class="input-append">
					<?php echo $this->Form->hidden('Relatorio.id'); ?>		
	    			<?php echo $this->Form->input('Relatorio.descricao', array('type' => 'text', 'label' => false, 'div' => false, 'class' => 'span5', 'placeholder' => 'Digite a descrição da conta contábil')); ?>
	    			<button type="submit" class="btn btn-primary">Gerar Relatório</button>
  				</div>
			<?php echo $this->Form->end();?>
	</div>
</div>

<script>
$(function() {
		
	//AutoComplete Executantes
	$('#RelatorioDescricao').autocomplete({
		source:'<?php echo $this->Html->url(array('controller' => 'conta_contabils', 'action' => 'autoComplete'))?>',
		select: function( event, ui ) {
					$("#RelatorioDescricao").val(ui.item.label);											
					$("#RelatorioId").val(ui.item.value);				
					return false;
				},
		focus: function(event, ui) { return false;}						
	});
});
</script>